import Ember from 'ember';

export default Ember.Controller.extend({
  init: function () {
    this._super.apply(this, arguments);

    var now = new Date();
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var date = now.getDate();
    this.set('selectedDate', [year, month, date]);
  },

  selectedDate: [],

  model: Ember.computed('selectedDate', {
    get: function () {
      return this.get('selectedDate');
    },

    set: function (key, value) {
      this.set('selectedDate', value);
      return value;
    }
  })
});
